<?php

use Illuminate\Database\Seeder;

class ArticleAndAuthorTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        //插入数据 -Article 表
        DB::table('article')->insert([
            [
                'article_name' => '如何让皮肤变好？',
                'author_id' => rand(1, 5)
            ],
            [
                'article_name' => '雅思有必要报班么？',
                'author_id' => rand(1, 5)
            ],
            [
                'article_name' => '女生被关注是什么感受？',
                'author_id' => rand(1, 5)
            ],
            [
                'article_name' => '有真正靠炒股发家致富的例子么？',
                'author_id' => rand(1, 5)
            ],
            [
                'article_name' => '当电影里的牛逼台词出现在显示生活中？',
                'author_id' => rand(1, 5)
            ],
        ]);
        //插入数据 - Author表
        DB::table('author')->insert([
           [
               'author_name'=>'木子李'
           ] ,
            [
                'author_name'=>'小臂还'
            ] ,
            [
                'author_name'=>'软软'
            ] ,
            [
                'author_name'=>'菜鸡'
            ] ,
            [
                'author_name'=>'麦迪狗子'
            ] ,
        ]);
    }
}
